from app.api import abstract
import operator

MAX_ITEMS = 100

class Action(abstract.Action):
    
    def _get(self):
        
        tags = abstract.models.tag.list(MAX_ITEMS)
            
        data = []
        
        for tag in tags:
            
            data.append({"name" : tag.name, "count" : tag.count})
        
        return sorted(data, key=operator.itemgetter("name"))